#!/usr/bin/env python3


import argparse
import json
from Fuzzer import BaseFuzzer,MessageFuzzer
from TLSMapper.TLSSUT import *
from TLSMapper.TLSProtocol import *

ciphersuites=[0x1301,0x1302,0x1303,0x00ff]


def main():
    ## # 创建参数解析器
    parser = argparse.ArgumentParser(description='Run the fuzzer with specified configuration')
    parser.add_argument('config', help='Path to the configuration JSON file')
    
    # 解析参数
    args = parser.parse_args()





    fuzzer = MessageFuzzer(args.config)

    # config = './configs/wolfssl.json'

    # fuzzer = MessageFuzzer(config)

    # alphabet1 = ['ClientHello', 'Certificate', 'ClientKeyExchange', 'CertificateVerify', 'ChangeCipherSpec', 'Finish', 'ApplicationData']
    # fuzzer.run_target_fast(alphabet1,1,5000)

    fuzzer.fuzz()
    fuzzer.clear()

    
    print("Fuzzing completed successfully.")



# python3 main2.py ./configs/openssl.json
if __name__ == "__main__":
    main()


    